home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3p / usvsema.z / usvsema
Encoding:
Text File  |  2002-10-03  |  2.9 KB  |  67 lines

  1.  
  2.  
  3.  
  4. UUUUSSSSVVVVSSSSEEEEMMMMAAAA((((3333PPPP))))                                                        UUUUSSSSVVVVSSSSEEEEMMMMAAAA((((3333PPPP))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      usvsema - release a semaphore
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<uuuulllloooocccckkkkssss....hhhh>>>>
  13.  
  14.      iiiinnnntttt uuuussssvvvvsssseeeemmmmaaaa ((((uuuusssseeeemmmmaaaa____tttt ****sssseeeemmmmaaaa))));;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _u_s_v_s_e_m_a increments the count associated with _s_e_m_a.  If there are any
  18.      processes queued waiting for the semaphore the first one is awakened.
  19.      _u_s_v_s_e_m_a uses the _u_s_e_m_a(7M) device to reactivate a suspended process.  If
  20.      the process to be awoken is no longer alive, _u_s_v_s_e_m_a will automatically
  21.      attempt to awaken the next process waiting for the semaphore.
  22.  
  23.      In order to use a semaphore, the caller must have joined the shared arena
  24.      out of which the semaphore is allocated (via _u_s_i_n_i_t(3P)), and have a file
  25.      descriptor to a _u_s_e_m_a device to unsuspend any waiting processes.  As a
  26.      convenience, _u_s_v_s_e_m_a will automatically do this for members of a share
  27.      group, or for related (via _f_o_r_k(2)) processes.  This automatic facility
  28.      can generate the same errors as _u_s_i_n_i_t(3P), and _u_s_o_p_e_n_p_o_l_l_s_e_m_a(3P).
  29.      These errors will be passed back to the caller.  If tracing is enabled
  30.      (see _u_s_i_n_i_t(_3_P)) then any errors will cause a message to be printed to
  31.      _s_t_d_e_r_r.  To avoid these errors and therefore not need to check for errors
  32.      on every _u_v_p_s_e_m_a call, have each process call _u_s_i_n_i_t(_3_P) and each user of
  33.      a pollable semaphore call _u_s_o_p_e_n_p_o_l_l_s_e_m_a(3P).
  34.  
  35.      The following error can always occur:
  36.  
  37.      [EBADF]        The underlying file descriptor for the semaphore was
  38.                     closed or re-used by the application.
  39.  
  40. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  41.      uscpsema(3P), usinit(3P), usinitsema(3P), usnewsema(3P),
  42.      usnewpollsema(3P), usopenpollsema(3P), uspsema(3P), ustestsema(3P),
  43.      usema(7M).
  44.  
  45. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  46.      Upon successful completion the semaphore has been released and a value of
  47.      0 is returned.  On error, -1 is returned and _e_r_r_n_o is set to indicate the
  48.      error.
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.